package dryven.request.controller;

import dryven.model.di.DependencyService;
import dryven.model.di.LocalThreadStorage;

public class DependencyInjectingControllerFactory implements ControllerFactory {

	private DependencyService diservice;
	
	public DependencyInjectingControllerFactory(DependencyService diservice) {
		super();
		this.diservice = diservice;
	}

	@Override
	public Object instanciateController(ControllerDescription cd, LocalThreadStorage storage) {
		return diservice.constructObject(storage, cd.getControllerClass());
	}
}
